********************************************************************************
********************************************************************************
*       Date:       September 2016                                       
*
*       Purpose:   	Do-file to replicate the results of the article 
*                  	"Taxing higher incomes: What makes the high-income earners 
*					consent to more progressive taxation in Latin America?"  
*    
*					Descriptives     
*
*       Authors:    Sarah Berens (University of Cologne)     
*					Armin von Schiller (German Development Institute & Hertie School of Governance)       
********************************************************************************


use "Data generated through datamanagement dofile", clear

sum countryID

svyset upm [pw=wt], strata (estratopri)

********
* Plot DV Differences across countries
********
drop if prog_tax==.

***********
* Create Figure 1 for categorical DV by country
***********
hist prog_tax,  discrete by(countryID) xlabel(minmax) percent addlabels
* suggested number of ticks, add value labels, range delta

***********
* Create Figure 2 for dichotomous DV and wealth group by country
***********
label define tax_dummy 1"prog." 0 "reg.", modify
label values tax_dummy tax_dummy

set more off
hist tax_dummy,  discrete  by(wealth_group, row(1) title("MEX") legend(off) note("")) xlabel(1 0) ylabel(0 (20) 90) xtitle("") ytitle("")  percent addlabels,  if countryID==1 
graph save MEX.gph, replace
hist tax_dummy,  discrete  by(wealth_group, row(1) title("GTM") legend(off) note("")) xlabel(1 0) ylabel(0 (20) 90) xtitle("") ytitle("") percent addlabels,  if countryID==2
graph save GTM.gph, replace
hist tax_dummy,  discrete  by(wealth_group, row(1) title("CRI") legend(off) note("")) xlabel(1 0) ylabel(0 (20) 90) xtitle("") ytitle("") percent addlabels,  if countryID==6
graph save CRI.gph, replace
hist tax_dummy,  discrete  by(wealth_group, row(1) title("COL") legend(off) note("")) xlabel(1 0) ylabel(0 (20) 90) xtitle("") ytitle("") percent addlabels,  if countryID==8
graph save COL.gph, replace
hist tax_dummy,  discrete  by(wealth_group, row(1) title("PER") legend(off) note("")) xlabel(1 0) ylabel(0 (20) 90) xtitle("") ytitle("") percent addlabels,  if countryID==11
graph save PER.gph, replace
hist tax_dummy,  discrete  by(wealth_group, row(1) title("CHL") legend(off) note("")) xlabel(1 0) ylabel(0 (20) 90) xtitle("") ytitle("") percent addlabels,  if countryID==13
graph save CHL.gph, replace
hist tax_dummy,  discrete  by(wealth_group, row(1) title("URY") legend(off) note("")) xlabel(1 0) ylabel(0 (20) 90) xtitle("") ytitle("") percent addlabels,  if countryID==14
graph save URY.gph, replace
hist tax_dummy,  discrete  by(wealth_group, row(1) title("BRA") legend(off) note("")) xlabel(1 0) ylabel(0 (20) 90) xtitle("") ytitle("") percent addlabels,  if countryID==15
graph save BRA.gph, replace
hist tax_dummy,  discrete  by(wealth_group, row(1) title("VEN") legend(off) note("")) xlabel(1 0) ylabel(0 (20) 90) xtitle("") ytitle("") percent addlabels,  if countryID==16
graph save VEN.gph, replace
hist tax_dummy,  discrete  by(wealth_group, row(1) title("ARG") legend(off) note("")) xlabel(1 0) ylabel(0 (20) 90) xtitle("") ytitle("") percent addlabels,  if countryID==17
graph save ARG.gph, replace

gr combine ARG.gph BRA.gph CHL.gph COL.gph CRI.gph GTM.gph MEX.gph PER.gph URY.gph VEN.gph , row(3) graphregion(margin(vsmall))







